<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

use yii\helpers\Url;
use app\models\U;

use app\models\MGoods;
use yii\jui\DatePicker;


/* @var $this yii\web\View */
/* @var $model app\models\MGoods */

$this->title = '商品对比';
//$this->params['breadcrumbs'][] = ['label' => '商品列表', 'url' => ['client-pubgoods-list',  'pub_type' =>$model->pub_type, 'goods_neworold' =>$model->goods_neworold]];
//$this->params['breadcrumbs'][] = "商品编号#".$this->title;

?>

<style type="text/css">
    img {
        width: 100%;
    }
</style>

<div class="mgoods-view">

    <h4>商品对比</h4>

    <table class="table table-bordered table-striped detail-view">
        <tr>
            <th width=10%>商品图</th>

            <td width=30%>  <?php echo Html::a('<img src=' . $g1->list_img_url .' width=35%>', 'index.php?r=site%2Fclient-goods-view&id='.$g1->goods_id); ?></td>
            <td width=30%>  <?php echo Html::a('<img src=' . $g2->list_img_url .' width=35%>', 'index.php?r=site%2Fclient-goods-view&id='.$g2->goods_id); ?></td>

            <?php if($g3 != -1) { ?>
                <td width=30%>  <?php echo Html::a('<img src=' . $g3->list_img_url .' width=35%>', 'index.php?r=site%2Fclient-goods-view&id='.$g3->goods_id); ?></td>
            <?php } ?>
        </tr>

        <tr>
            <th width=10%>品名</th>

            <td><?= $g1->title ?></td>
            <td><?= $g2->title ?></td>

            <?php if($g3 != -1) { ?>
            <td><?= $g3->title ?></td>
            <?php } ?>
        </tr>

        <tr><th width=10%>一级分类</th>
            <td><?= $g1->getKindName($g1->goods_kind ) ?></td>
            <td><?= $g2->getKindName($g2->goods_kind ) ?></td>

            <?php if($g3 != -1) { ?>
                <td><?= $g3->getKindName($g3->goods_kind ) ?></td>
            <?php } ?>
        </tr>

        <tr><th width=10%>二级分类</th>
            <td><?= $g1->getKindName($g1->goods_subkind ) ?></td>
            <td><?= $g2->getKindName($g2->goods_subkind ) ?></td>

            <?php if($g3 != -1) { ?>
                <td><?= $g3->getKindName($g3->goods_subkind ) ?></td>
            <?php } ?>
        </tr>

        <tr><th width=10%>三级分类</th>
            <td><?= $g1->getKindName($g1->goods_3rdkind ) ?></td>
            <td><?= $g2->getKindName($g2->goods_3rdkind ) ?></td>

            <?php if($g3 != -1) { ?>
                <td><?= $g3->getKindName($g3->goods_3rdkind ) ?></td>
            <?php } ?>
        </tr>

        <tr><th width=10%>发布方式</th>
            <td><?= $g1->getPubType($g1 ) ?></td>
            <td><?= $g2->getPubType($g2) ?></td>

            <?php if($g3 != -1) { ?>
                <td><?= $g3->getPubType($g3) ?></td>
            <?php } ?>
        </tr>

        <tr><th width=10%>商品成色</th>
            <td><?= $g1->getGoodsNeworold($g1 ) ?></td>
            <td><?= $g2->getGoodsNeworold($g2) ?></td>

            <?php if($g3 != -1) { ?>
                <td><?= $g3->getGoodsNeworold($g3) ?></td>
            <?php } ?>
        </tr>

        <tr><th width=10%>主要参数</th>
            <td><?= $g1->parameter ?></td>
            <td><?= $g2->parameter ?></td>

            <?php if($g3 != -1) { ?>
                <td><?= $g3->parameter ?></td>
            <?php } ?>
        </tr>

        <tr><th width=10%>附件</th>
            <td><?= $g1->attachment ?></td>
            <td><?= $g2->attachment ?></td>

            <?php if($g3 != -1) { ?>
                <td><?= $g3->attachment ?></td>
            <?php } ?>
        </tr>
        
        <tr><th width=10%>品牌</th>
            <td><?= $g1->getBrand($g1) ?></td>
            <td><?= $g2->getBrand($g2) ?></td>

            <?php if($g3 != -1) { ?>
                <td><?= $g3->getBrand($g3) ?></td>
            <?php } ?>
        </tr>

        <tr><th width=10%>型号</th>
            <td><?= $g1->model ?></td>
            <td><?= $g2->model ?></td>

            <?php if($g3 != -1) { ?>
                <td><?= $g3->model ?></td>
            <?php } ?>
        </tr>

        <tr><th width=10%>产地</th>
            <td><?= $g1->prod_area ?></td>
            <td><?= $g2->prod_area ?></td>

            <?php if($g3 != -1) { ?>
                <td><?= $g3->prod_area ?></td>
            <?php } ?>
        </tr>

    </table>
<br><br>
</div>

